package shelly.test;

import java.util.LinkedHashSet;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @author: Shelly
 * @create: 2023-03-09 14:44:28
 * @version: 1.0
 * @describe:
 */
public class CollectionTest9 {
    public static void main(String[] args) {
        LinkedHashSet<Integer> hs = new LinkedHashSet<>();
        System.out.println(hs.add(19));//true
        hs.add(5);
        hs.add(20);
        System.out.println(hs.add(19));//false 这个19没有放入到集合中
        hs.add(41);
        hs.add(0);
        System.out.println(hs.size());//唯一，无序
        System.out.println(hs);

    }
}
